home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8080 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: wup-gate.wup.de!mlc
  2. From: mlc@wup.de (Michael Lechner)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Bug? MSVC++ 4.0, Windows 95, Virtual Destructors, & DLL's
  5. Date: 14 Feb 1996 11:40:33 GMT
  6. Organization: Wiechers & Partner Datentechnik GmbH, D-40789 Monheim
  7. Message-ID: <4fshnh$k64@wup-gate.wup.de>
  8. References: <3117efd3.956426@news.primenet.com>
  9. NNTP-Posting-Host: 149.237.31.100
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Gary Edstrom (gbe@primenet.com) wrote:
  13. : Here's a strange problem that I have been trying to figure out all day
  14. : today.  I have a program that consists of 2 parts:
  15.  
  16. :   1. A  DLL that contains a simple class with an empty constructor
  17. :      and an empty virtual destructor.
  18.  
  19. :   2. An EXE that contains exactly the same type of class, but with a
  20. :      different name.
  21.  
  22. : [...]
  23. : Can anyone else duplicate this problem?  Does anyone have any idea
  24. : what is going on?  Have I come across some sort of compiler bug?  The
  25. : only clue that I seem to have discovered is that the first version
  26. : (the one resident in the EXE file) executes an internal function
  27. : called "scaler deleting destructor", while the second version (the one
  28. : defined in the DLL file) executes an internal function called "vector
  29. : deleting destructor".
  30.  
  31. I don't believe that your example points to the problem! I could
  32. not reproduce the error (using VC++ 2.2).
  33.  
  34. :     object2 * o2 = new object2;
  35. :     delete o2;    // This delete executes OK
  36. :     }
  37.  
  38. :     {
  39. :     object1 * o1 = new object1;
  40. :     delete o1;    // This delete produces an assertion error
  41. :     }
  42.  
  43. delete o1 should never call the delete[] operator. Anyway you
  44. should now that msvc overload the operator new and delete if you
  45. compile with debug - option.
  46.  
  47. cu
  48.  
  49. Michael
  50.  
  51.  
  52. --
  53.      +-------------------------------+--------------------------------------+
  54.      | Michael Lechner               | Wiechers & Partner Datentechnik GmbH |
  55.      |                               | Forschung & Entwicklung (R&D)        |
  56.      |                               | An der alten Ziegelei 2              |
  57.      | eMail: mlc@wupmon.wup.de      | D-40771 Monheim (Germany)            |
  58.      +-------------------------------+--------------------------------------+
  59.  
  60.